import { Component, OnInit, ViewChild } from "@angular/core";
import { Pl00EditorPageComponent } from "./pl00-editor-page/pl00-editor-page.component";

@Component({
  selector: "app-root",
  templateUrl: "./app.component.html",
  styleUrls: ["./app.component.css"],
})
export class AppComponent {
  @ViewChild(Pl00EditorPageComponent) editorPage: Pl00EditorPageComponent;
  title = "pl00-webide";
  isSettingVisible = false;
  isIntroductionVisible = false;
  isModulesVisible = false;
  get autoLoopRestriction() {
    return this.editorPage?.editor?.autoLoopRestriction ?? 500;
  }
  set autoLoopRestriction(value: number) {
    const temp = this.editorPage?.editor?.autoLoopRestriction;
    if (temp !== null && temp !== undefined) {
      this.editorPage.editor.autoLoopRestriction = value;
    }
  }
  get maxLoopRestriction() {
    return this.editorPage?.editor?.maxLoopRestriction ?? 1000000;
  }
  set maxLoopRestriction(value: number) {
    const temp = this.editorPage?.editor?.maxLoopRestriction;
    if (temp !== null && temp !== undefined) {
      this.editorPage.editor.maxLoopRestriction = value;
    }
  }
}
